package com.caozf.singleton.threadlocal;

import sun.security.jca.GetInstance;

/**
 * 创建时间：2019/9/13 18:00
 * 创建人:曹子方
 */
public class ThreadLocalSingleton {
    private static final ThreadLocal<ThreadLocalSingleton> threadLocal=new ThreadLocal<ThreadLocalSingleton>(){
        @Override
        protected ThreadLocalSingleton initialValue() {
            return new ThreadLocalSingleton();
        }
    };
    private ThreadLocalSingleton() {

    }
    public static ThreadLocalSingleton getInstance(){
        return threadLocal.get();
    }
}
